﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Report_Change_ReduceUnit_Detail.aspx.cs"
    Inherits="EcSalseManage.EcSalse.Report_Change_ReduceUnit_Detail" %>

<%@ Register Src="../PageCommon/Report_Tab.ascx" TagName="Report_Tab" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>项目销售管理系统-非当月减成交价</title>

    <script language="javascript" type="text/javascript" src="../js/My97DatePicker/WdatePicker.js"></script>

    <script language="javascript" type="text/javascript" src="../js/jquery-1.6.2.min.js"></script>

    <link href="../css/skin.css" type="text/css" rel="stylesheet">
    <style type="text/css">
        </style>

    <script type="text/javascript">
        function checkUpload() {
            if (document.all.ddlFileType.value == "") {
                alert("请选择附件类型！");
                return false;
            }
            if (document.getElementById("txtFilePath").value == "") {
                alert("项目附件不能为空！");
                return false;
            }
        }
        
        function DataCheck() {
            if (checkFujian() == true) {
                if (document.all.ddlFileType.value == "") {
                    alert("请选择附件类型！");
                    return false;
                }
                if (document.getElementById("txtFilePath").value == "") {
                    alert("项目附件不能为空！");
                    return false;
                }
            }
        }

        function checkFujian() {
            var ar = document.getElementsByTagName("a");
            for (var i = 0; i < ar.length; i++) {
                var temp = ar[i].href;
                if (temp.indexOf("gzs-ecc02", 0) > 0) {
                    return false;
                }
            }
            return true;
        }

        function rdlFileID_Validation(sender, args) {
            args.IsValid = ($("#rdlFileID :radio:checked").length > 0);
        }

        function rdlReasonID_Validation(sender, args) {
            args.IsValid = ($("#rdlReasonID :radio:checked").length > 0);
        }

        //验证CheckBoxList的方法
        function ctvCar_Validation(sender, args) {
            // CustomValidator控件通过自定义函数的参数args属性IsValid来判断是否验证通过
            args.IsValid = ($("#chkCar input:checked").length >= 0);
        }

        function ClearText() {
            $("input").each(function() {
                $(this).val('');
            });
        }

        function addRow() {
            var FilePath = document.getElementById("txtFilePath");
            if (FilePath.value == "") {
                alert("请选择上传文件");
                return false;
            }

            var objMyTable = document.getElementById("tempTable");
            objMyTable.style.display = "block";
            var index = objMyTable.rows.length;
            var nextRow = objMyTable.insertRow(index);
            nextRow.setAttribute("style", "background-color:rgb(248, 244, 228)");

            var newCellCartonNo1 = nextRow.insertCell();
            var obj = document.getElementById("ddlFileType");
            var n = obj.selectedIndex;
            newCellCartonNo1.innerHTML = obj.options[n].text;

            document.getElementById("HiddenField1").value += "" + obj.options[n].value + "," + document.getElementById("txtFilePath").value + "," + document.getElementById("txtProjectDesc").value + "|";

            var newCellCartonNo4 = nextRow.insertCell();
            newCellCartonNo4.innerHTML = "<input style='border-width: 0px; border-style: dotted;'  onclick='deleteRow(" + index + ")'   src='..../images/delete.gif' type='image'>";
        }

        function deleteRow(obj) {

            var temp = document.getElementById("HiddenField1").value;

            temp = temp.substring(0, temp.length - 1);

            var arrayObj = temp.split("|");
            arrayObj.splice(obj - 1, 1);
            temp = "";
            for (i = 0; i < arrayObj.length; i++) {
                temp += arrayObj[i] + "|";
            }
            document.getElementById("HiddenField1").value = temp;

            document.getElementById("tempTable").deleteRow(obj);
        }  
       
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
            <td width="17" valign="top" background="../images/mail_leftbg.gif">
                <img src="../images/left-top-right.gif" width="17" height="29" />
            </td>
            <td valign="top" background="../images/content-bg.gif">
                <uc1:Report_Tab ID="Report_Tab1" runat="server" Visible="False" ExchangeTypeID="9" />
            </td>
            <td width="16" valign="top" background="../images/mail_rightbg.gif">
                <img src="../images/nav-right-bg.gif" width="16" height="29" />
            </td>
        </tr>
        <tr>
            <td valign="middle" background="../images/mail_leftbg.gif">
                &nbsp;
            </td>
            <td valign="top" bgcolor="#F7F8F9">
                <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
                    <tr>
                        <td align="left" colspan="4">
                            <p>
                                项目名称：<asp:Label ID="lblProjectName" runat="server" Text=""></asp:Label>
                            </p>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4" valign="top">
                            <center>
                                <table style="text-align: left;">
                                    <tr>
                                        <td colspan="2">
                                            <center>
                                                <span style="font-family: Arial; font-size: 28px; font-weight: normal; font-style: normal;
                                                    text-decoration: none; color: #333333;">应收佣金调整报告</span><br />
                                                <hr style="width: 80%" />
                                                <br />
                                            </center>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            致： 财务部
                                        </td>
                                        <td>
                                            楼 盘：<asp:TextBox ID="txtBuilding" class="edline" runat="server"></asp:TextBox><asp:RequiredFieldValidator
                                                ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtBuilding" Display="None"
                                                ErrorMessage="楼盘不能为空"></asp:RequiredFieldValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            部门：项目部 销售组
                                        </td>
                                        <td>
                                            日 期：<asp:TextBox ID="txtFillDate" class="edline Wdate" runat="server" onclick="WdatePicker({dateFmt:'yyyy/MM/dd'})"></asp:TextBox><asp:RequiredFieldValidator
                                                ID="RequiredFieldValidator2" runat="server" Display="None" ControlToValidate="txtFillDate"
                                                ErrorMessage="日期不能为空"></asp:RequiredFieldValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            物业：<asp:TextBox ID="txtAddress" class="edline" runat="server"></asp:TextBox><asp:RequiredFieldValidator
                                                ID="RequiredFieldValidator3" Display="None" ControlToValidate="txtAddress" runat="server"
                                                ErrorMessage="物业不能为空"></asp:RequiredFieldValidator>
                                        </td>
                                        <td>
                                            经办人：<asp:TextBox ID="txtOperater" class="edline" runat="server"></asp:TextBox><asp:RequiredFieldValidator
                                                ID="RequiredFieldValidator4" runat="server" Display="None" ControlToValidate="txtOperater"
                                                ErrorMessage="经办人不能为空"></asp:RequiredFieldValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2">
                                            物业成交编号：<asp:TextBox ID="txtReportNO" Style="width: 400px;" class="edline" runat="server"></asp:TextBox><asp:RequiredFieldValidator
                                                ID="RequiredFieldValidator5" runat="server" Display="None" ControlToValidate="txtReportNO"
                                                ErrorMessage="物业成交编号不能为空"></asp:RequiredFieldValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2">
                                            物业成交日期：<asp:TextBox ID="txtExchangeDate" Style="width: 400px;" class="edline Wdate"
                                                runat="server" onclick="WdatePicker({dateFmt:'yyyy/MM/dd'})"></asp:TextBox><asp:RequiredFieldValidator
                                                    ID="RequiredFieldValidator6" runat="server" Display="None" ControlToValidate="txtExchangeDate"
                                                    ErrorMessage="物业成交日期不能为空"></asp:RequiredFieldValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            ①原成交价：人民币<asp:TextBox ID="txtFormlyerPrice" class="edline" runat="server"></asp:TextBox><asp:RequiredFieldValidator
                                                ID="RequiredFieldValidator7" runat="server" Display="None" ControlToValidate="txtFormlyerPrice"
                                                ErrorMessage="原成交价不能为空"></asp:RequiredFieldValidator>
                                        </td>
                                        <td>
                                            ②现成交价：人民币<asp:TextBox ID="txtNowPrice" class="edline" runat="server"></asp:TextBox><asp:RequiredFieldValidator
                                                ID="RequiredFieldValidator8" runat="server" Display="None" ControlToValidate="txtNowPrice"
                                                ErrorMessage="现成交价不能为空"></asp:RequiredFieldValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2">
                                            ③成交价调整：人民币<asp:TextBox ID="txtAdjustPrice" class="edline" runat="server"></asp:TextBox><asp:RequiredFieldValidator
                                                ID="RequiredFieldValidator9" runat="server" Display="None" ControlToValidate="txtAdjustPrice"
                                                ErrorMessage="成交价调整不能为空"></asp:RequiredFieldValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            ④应收佣金：人民币<asp:TextBox ID="txtComm" class="edline" runat="server"></asp:TextBox><asp:RequiredFieldValidator
                                                ID="RequiredFieldValidator10" runat="server" Display="None" ControlToValidate="txtComm"
                                                ErrorMessage="应收佣金不能为空"></asp:RequiredFieldValidator>
                                        </td>
                                        <td>
                                            ⑤实收佣金：人民币<asp:TextBox ID="txtActual" class="edline" runat="server"></asp:TextBox><asp:RequiredFieldValidator
                                                ID="RequiredFieldValidator11" runat="server" Display="None" ControlToValidate="txtActual"
                                                ErrorMessage="实收佣金不能为空"></asp:RequiredFieldValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            ⑥调整佣金：港币/人民币<asp:TextBox ID="txtAdjustComm" class="edline" runat="server"></asp:TextBox><asp:RequiredFieldValidator
                                                ID="RequiredFieldValidator12" runat="server" Display="None" ControlToValidate="txtAdjustComm"
                                                ErrorMessage="调整佣金不能为空"></asp:RequiredFieldValidator>
                                        </td>
                                        <td>
                                            <table>
                                                <tr>
                                                    <td>
                                                        导致原因：
                                                    </td>
                                                    <td>
                                                        <asp:RadioButtonList ID="rdlReasonID" RepeatDirection="Horizontal" runat="server">
                                                        </asp:RadioButtonList>
                                                        <asp:CustomValidator ID="CustomValidator2" Display="None" ClientValidationFunction="rdlReasonID_Validation"
                                                            runat="server" ErrorMessage="导致原因至少选择一种"></asp:CustomValidator>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2">
                                            注：③=①-② ⑥=④-⑤
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2">
                                            <table>
                                                <tr>
                                                    <td>
                                                        承诺文件：
                                                    </td>
                                                    <td>
                                                        <asp:RadioButtonList ID="rdlFileID" RepeatDirection="Horizontal" runat="server">
                                                        </asp:RadioButtonList>
                                                        <asp:CustomValidator ID="CustomValidator1" Display="None" ClientValidationFunction="rdlFileID_Validation"
                                                            runat="server" ErrorMessage="承诺文件至少选择一种"></asp:CustomValidator>
                                                    </td>
                                                </tr>
                                            </table>
                                    </tr>
                                    <tr>
                                        <td colspan="2">
                                            <table>
                                                <tr>
                                                    <td valign="top">
                                                        原因：
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="txtReason" Rows="3" Width="500px" TextMode="MultiLine" runat="server"></asp:TextBox>
                                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator13" runat="server" Display="None"
                                                            ControlToValidate="txtReason" ErrorMessage="原因不能为空"></asp:RequiredFieldValidator>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2">
                                            <table class="page" style="width: 100%;">
                                                <tr>
                                                    <td>
                                                        附件类型：
                                                    </td>
                                                    <td colspan="3" align="left">
                                                        <asp:DropDownList ID="ddlFileType" runat="server">
                                                        </asp:DropDownList>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td align="left" style="font-size: 15px;">
                                                        上传文件:
                                                    </td>
                                                    <td align="left" colspan="3">
                                                        <font face="宋体">
                                                            <input id="txtFilePath" runat="server" name="UploadFile" style="font-size: 9pt; width: 388px"
                                                                type="file" />
                                                        </font>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td align="left" style="font-size: 15px;">
                                                        其他资料:
                                                    </td>
                                                    <td align="left" colspan="3">
                                                        <font face="宋体">
                                                            <asp:TextBox ID="txtProjectDesc" runat="server" Width="384px"></asp:TextBox></font>
                                                        <asp:Button ID="btnUpLoad" Style="background-image: url(../images/pic15.gif); border-color: #ffffff;
                                                            background-repeat: no-repeat; padding-left: 17px;" runat="server" Visible="false"
                                                            Text="上传" OnClick="btnUpLoad_Click" />
                                                        <asp:HiddenField ID="HiddenField1" runat="server" />
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2">
                                            <table id="tempTable" style="display: none; border-width: 0px; border-style: dotted;
                                                width: 600px; background-color: rgb(192, 255, 192);" border="0" rules="all" cellspacing="1"
                                                cellpadding="1">
                                                <tr style="background-color: rgb(216, 200, 168);" class="ttTable" align="center">
                                                    <td>
                                                        上传资料名称
                                                    </td>
                                                    <td style="width: 40px;">
                                                        删除
                                                    </td>
                                                </tr>
                                            </table>
                                            <asp:DataGrid ID="dgList" Visible="false" runat="server" AutoGenerateColumns="False"
                                                BackColor="#C0FFC0" BorderStyle="Dotted" BorderWidth="0px" CellPadding="1" CellSpacing="1"
                                                DataKeyField="Project_Report_ID" PageSize="20" Width="600px" OnItemCommand="dgList_ItemCommand"
                                                OnItemDataBound="dgList_ItemDataBound">
                                                <PagerStyle Mode="NumericPages" Position="TopAndBottom" />
                                                <AlternatingItemStyle BackColor="#F0F0E8" CssClass="td" />
                                                <ItemStyle BackColor="#F8F4E4" CssClass="td" />
                                                <HeaderStyle BackColor="#D8C8A8" CssClass="ttTable" HorizontalAlign="Center" />
                                                <Columns>
                                                    <asp:HyperLinkColumn DataNavigateUrlField="Project_Report_FilePath" DataTextField="Report_File_Name"
                                                        HeaderText="上传资料名称" Target="_blank"></asp:HyperLinkColumn>
                                                    <asp:TemplateColumn HeaderText="删除">
                                                        <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False"
                                                            Font-Underline="False" HorizontalAlign="Center" Wrap="False" />
                                                        <ItemTemplate>
                                                            <asp:ImageButton ID="imgbtnDelete" runat="server" AlternateText="删除" BorderStyle="Dotted"
                                                                BorderWidth="0px" CommandName="Delete" ImageAlign="Middle" ImageUrl="..../images/delete.gif" />
                                                        </ItemTemplate>
                                                        <HeaderStyle Width="40px" />
                                                    </asp:TemplateColumn>
                                                </Columns>
                                            </asp:DataGrid>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2">
                                            <center>
                                                <table>
                                                    <tr>
                                                        <td>
                                                            <asp:Button ID="btnSave" runat="server" Text="保存" CausesValidation="false" 
                                                                OnClick="btnSave_Click" />&nbsp;&nbsp;&nbsp;&nbsp;
                                                        </td>
                                                        <td>
                                                            <input id="btnReset" runat="server" type="reset" value="重置" />&nbsp;&nbsp;&nbsp;&nbsp;
                                                            <asp:Button ID="btnDelete" Visible="false" runat="server" Text="删除" OnClick="btnDelete_Click" />&nbsp;&nbsp;&nbsp;&nbsp;
                                                            <asp:Button ID="btnAudit" runat="server" OnClientClick="if(confirm('是否确定审核通过？')){return true;}else{return false;}" OnClick="btnAudit_Click" Text="营销[副]总监审核" />
                                                        </td>
                                                    </tr>
                                                </table>
                                                <asp:ValidationSummary ID="ValidationSummary1" ShowMessageBox="true" ShowSummary="false"
                                                    runat="server" />
                                            </center>
                                        </td>
                                    </tr>
                                </table>
                            </center>
                        </td>
                    </tr>
        </tr>
        <tr>
            <td height="40" colspan="4">
                <table width="100%" height="1" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
                    <tr>
                        <td>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td width="2%">
                &nbsp;
            </td>
            <td width="51%" class="left_txt">
                <img src="../images/icon-mail2.gif" width="16" height="11">
                客户服务邮箱：servers@centaline.com<br>
                <img src="../images/icon-phone.gif" width="17" height="14">
                官方网站：http://www.centaline.com.cn/
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
    </table>
    </td>
    <td background="../images/mail_rightbg.gif">
        &nbsp;
    </td>
    </tr>
    <tr>
        <td valign="bottom" background="../images/mail_leftbg.gif">
            <img src="../images/buttom_left2.gif" width="17" height="17" />
        </td>
        <td background="../images/buttom_bgs.gif">
            <img src="../images/buttom_bgs.gif" width="17" height="17">
        </td>
        <td valign="bottom" background="../images/mail_rightbg.gif">
            <img src="../images/buttom_right2.gif" width="16" height="17" />
        </td>
    </tr>
    </table>
    </form>
</body>
</html>
